
<div>
	<span>
		<%= image_tag "smart_groups.gif", :size => "16x16", :border => 0 %>
		<strong>Smart Groups</strong>
	</span>
	<span>
		<%= link_to 'new', :controller => 'smart_groups', :action => 'new' %>
	</span>
</div>
<% SmartGroup.find(:all).sort_by(&:name).each do |g| %>
	<div style="margin-left:1em;float:none; clear:both;border-top: solid 1px grey;">
		<div id="group_id_<%= g.id %>_info" style="float:none; clear:both;margin:.5em;">
			<span class="cell">
				<%= image_tag "smart_group.gif", :size => "16x18" %>
			</span>
			<span class="cell" style="width: 170px;">
				<strong><%= g.name %></strong>
			</span>
			<span  class="cell tiny" style="width: 400px; margin-bottom:.5em;">
				<%= g.smart_group_rules.collect {|r| r.prose} %>
			</span>
			<span class="cell">
				<%= link_to (image_tag "zoom_16x16.gif", :size => "12x12", :border => 0, :title => 'Show Details'), :controller => 'smart_groups', :action => 'show', :id => g.id %>
			</span>
			<span>
				<%= link_to_remote "show", :url => {:action => 'show_people', :id => g.id} %>
			</span>
			<span>
				<%= link_to_remote "hide", :url => {:action => 'hide_people', :id => g.id} %>
			</span>
			<span><%= link_to_remote (image_tag "delete_16x16.gif", :size => "12x12", :border => 0, :title => "Delete this smart group"),
															 :url => {:controller => 'smart_groups', :action => 'delete_smart_group',
															 :id => g.id}, :confirm => "Are you sure you want to delete this smart group?" %></span>
		</div>
	</div>
	
		<% @g = g %>
	<div id="smart_group_id_<%= g.id %>_controls" style="margin-left:3em;float:none; clear:both;">
	
		<%# render :partial => "smart_group_controls", :locals => {:g => @g.id} %>
	</div>
	
	<div id="smart_group_<%= g.id %>_people" style="margin-left:3em;float:none; clear:both;">
		<%# render :partial => "person", :collection => g.found_people %>
	</div>

<% end %>

